//
//  TabBarViewController.swift
//  swfitTest
//
//  Created by hncy on 2021/12/24.
//

import UIKit

class TabBarViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.creatTabbar()
    }
   
    func creatTabbar() -> Void {
        let home = HomeViewController()
        let homeVc = UINavigationController(rootViewController: home)
        home.title = "首页"
        
        let me = MeViewController()
        let meVc = UINavigationController(rootViewController: me)
        meVc.title = "我的"
        
        let tabArr = [homeVc, meVc]
        self.viewControllers = tabArr
        
        //底部工具栏背景颜色
        self.tabBar.barTintColor=UIColor.white;
        //.设置底部工具栏文字颜色（默认状态和选中状态）(选中状态为蓝色)
//        UITabBarItem.appearance().setTitleTextAttributes(NSAttributedString.Key., for: .normal)
//        UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object:UIColor.white, forKey:NSForegroundColorAttributeName as NSCopying) as? [String : AnyObject], for: UIControl.State.normal);
//        UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object:UIColor.blue, forKey:NSForegroundColorAttributeName as NSCopying) as? [String : AnyObject], for: UIControl.State.selected)
              
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
